﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ZJF.StrToVal
{
    internal class Program
    {
        static void Main(string[] args)
        {
            //Test1();
            //Test2();
            //Test3();
            //Test4();
            //Test5();
            //Test6();
            Test7();
            Console.Read();
        }

        static void Test1()
        {
            int a = 100;
            double b = a;

            Console.WriteLine($"a={a},b={b}");
        }

        static void Test2()
        {
            double a = 100;
            int b = (int)a;
            Console.WriteLine($"a={a},b={b}");
        }

        static void Test3()
        {
            string a = "100";
            string b = "100.5";
            int c = int.Parse(a);
            double d = double.Parse(b);
            Console.WriteLine($"c={c},d={d}");
        }

        static void Test4()
        {
            string a = "100.5";
            int b = int.Parse(a);
            Console.WriteLine(b);
        }

        static void Test5()
        {
            string a = "100.6";
            int b = (int)double.Parse(a);
            Console.WriteLine(b);
        }

        static void Test6()
        {
            double a = 100.8;
            Console.WriteLine(a.ToString());
        }

        static void Test7()
        {
            int a = Convert.ToInt32("1");
            double b = Convert.ToDouble("100.89");
            string c = Convert.ToString(1111);
            Console.WriteLine($"a={a},b={b},c={c}");
        }
    }
}
